<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ page isELIgnored="false"%>
	<%@ taglib uri="/struts-tags" prefix="s"%>
	<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>用户信息列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="${pageContext.request.contextPath}/styles/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.odd {
	margin:0 0 0 0;
	padding: 0.5em;
	background: blue;
}
table th, table td {border: none;color:#ffffff;}
</style>
</head>
<body>
<div class="main">

  <div class="slider2">
    <div class="slider4_resize">
      <h2>用户信息列表</h2>
    </div>
    <div class="clr"> </div>
  </div>
  <div class="clr"> </div>
  <div class="body">
    <div class="body_resize2">
      <p><strong></strong><br />
        </p>
       <s:actionerror />
     <table>
		<tr>
			<th>编号id</th>
			<th>用户邮箱</th>
			<th>用户昵称</th>
			<th>权限类别</th>
			<th>创建时间</th>
			<th>操作</th>
		</tr>
        <c:forEach var="user_list" items="${requestScope.userList}" varStatus="status">
			<!-- 隔行变色效果 -->
			<!-- 判断status.count是否为奇数,如果为奇数设置该行背景颜色为蓝色 -->
			<tr 
				<c:if test="${status.count % 2 == 1}">
					class = "odd"
				</c:if>
			>
				<td>${status.count}</td>
				<td>${user_list.us_email}</td>
				<td>${user_list.us_nickname}</td>
				<c:if test="${user_list.us_type==5}"><td>普通用户</td></c:if>
				<c:if test="${user_list.us_type!=5}"><td>管理员</td></c:if>
				<td>${user.us_createtime}</td>
				<!-- 配置管理员的权限 -->
				<c:if test="${sessionScope.admin.us_type==0}">
				<td>
			<a href="
				<c:url value="change_user">
					<c:param name="user.us_id" value="${user_list.us_id}"/>
				</c:url>"
			>修改</a> &nbsp; 
			<a href="
				<c:url value="del_user">
					<c:param name="user.us_id" value="${user_list.us_id}"/>
				</c:url>"
			 	onclick="return confirm('确定删除改用户?')"
			>删除</a>
			
			</td>
			</c:if>
			<c:if test="${sessionScope.admin.us_type!=0}">
			<td>你无权操作</td>
			</c:if>
			</tr>
			
		</c:forEach>
	</table>  
	<p>
	 <!-- ======================分页超链接======================================= -->
    <!-- 判断事是否就一页信息 且为第一页 -->  
   <c:if test="${(allPage-1)==offsetPage&&(offsetPage==0)}">
   <a href="#">当前为最后</a>
   </c:if>
    <!-- 判断当前是最后一页 -->  
   <c:if test="${((allPage-1)==offsetPage)&&(offsetPage!=0)}">
   <a href="
				<c:url value="find_alluser">
					<c:param name="offsetPage" value="${offsetPage-1}"/>
				</c:url>
		">上一页</a>
   <a href="#">当前为最后</a>
   </c:if>
   <!-- 判断事是否>一页信息 且为第一页 --> 
   <c:if test="${((allPage-1)!=offsetPage)&&(offsetPage==0)}">
   <a href="
				<c:url value="find_alluser">
					<c:param name="offsetPage" value="${offsetPage+1}"/>
				</c:url>
		">下一页</a>
   </c:if>
    <!-- 判断事是否不是组后一页信息 且不为第一页 --> 
    <c:if test="${((allPage-1)!=offsetPage)&&(offsetPage!=0)}">
   <a href="
				<c:url value="find_alluser">
					<c:param name="offsetPage" value="${offsetPage-1}"/>
				</c:url>
		">上一页</a>
	<a href="
				<c:url value="find_alluser">
					<c:param name="offsetPage" value="${offsetPage+1}"/>
				</c:url>
		">下一页</a>	
   </c:if>
    <!-- ======================分页超链接结束======================================= --> 
  当前页码${offsetPage+1}  总页数${allPage}
    </p>
    </div>
    <div class="clr"></div>
  </div>

</div>
</body>
</html>